package main

func main()  {
	arr := []int{1,2,3,4,5,6,7}
}
type buildNode struct {
	val int
	left *buildNode
	right *buildNode
}
func buildTreeNode(i int,arr []int) *buildNode {
	if i > len(arr) {
		return nil
	}
	node := &buildNode{
		val:   arr[i],
		left:  nil,
		right: nil,
	}
	if 2*i+1 < len(arr) {
		node.left = buildTreeNode(2*i,arr)
	}
	if 2*i+2 < len(arr) {
		node.left = buildTreeNode(2*i,arr)
	}

	return node
}
